/**    
* @Title: MD5Utils.java
* @Package: org.vdalf.gsgz.utils
* @author vDalf 2020-09-28 11:40:59 上午11:40:59
* @Copyright © 2020 vDalf Block-Chain Foundation (In Preparation Non-Governmental Organization) All rights reserved.
*/
package org.vdalf.gsgz.utils;

import org.springframework.util.DigestUtils;

/**    
* @Title: MD5Utils.java
* @Package: org.vdalf.gsgz.utils
* @Description: 
* @author vDalf 2020-09-28 11:40:59 上午11:40:59
*/
public class MD5Utils {

	public static String md5(String plain) {
		return DigestUtils.md5DigestAsHex(plain.getBytes()).toUpperCase();
	}
	
	public static String md5(byte[] bytes) {
		return DigestUtils.md5DigestAsHex(bytes).toUpperCase();
	}
	
	public static String md5WithSalt(String plain,Object salt) {
		return md5(plain + salt);
	}
	
}
